<!DOCTYPE html>
<html lang="en">
<body>
	<div>remove me</div>
	<script
		src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
	<script>
		(function($) {
			$('div').remove()
					.html('<a href="http://www.jQuery.com">jQuery</a>')
					.appendTo('body');
		})(jQuery);
	</script>
</body>
</html>